﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMIS.BLL
{
    public class Identify
    {
        /// <summary>
        /// 获取指定ID号对应的实习鉴定表
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public Model.Identify Get(Guid guid)
        {
            DAL.Identify dal=DALFactory.DALFactory.CreateIdentify();
            return dal.Get(guid);
        }
        /// <summary>
        /// 获取指定ID号的对应的教师名称
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public string GetFirseTeacher(Guid guid)
        {
            DAL.Student sdal = DALFactory.DALFactory.CreateStudent();
            guid = sdal.SearchByTeacherID(guid);
            DAL.Teacher tdal = DALFactory.DALFactory.CreateTeacher();
            string name = tdal.GetName(guid);
            return name;
        }
        /// <summary>
        /// 获取所有教师名称
        /// </summary>
        /// <returns></returns>
        public string[] GetTeacher()
        {
            DAL.Teacher dal = DALFactory.DALFactory.CreateTeacher();
            return dal.GetName();
        }
        /// <summary>
        /// 获取指定教师名称的对应ID号
        /// </summary>
        /// <param name="teachername"></param>
        /// <returns></returns>
        public Guid GetID(string teachername)
        {
            DAL.Teacher dal = DALFactory.DALFactory.CreateTeacher();
            return dal.GetName(teachername);
        }
        /// <summary>
        /// 更新鉴定表信息
        /// </summary>
        /// <param name="ide"></param>
        public void Update(Model.Identify ide)
        {
            DAL.Identify dal = DALFactory.DALFactory.CreateIdentify();
            dal.Update(ide);
        }
    }
}
